/*
 * This file is a part of qloudgen-esb. 
 * You can redistribute qloudgen-esb and/or modify it under the terms of the Lesser GNU General Public License version 3. 
 * qloudgen-esb is distributed WITHOUT ANY WARRANTY. 
 * 
 * See the Lesser GNU General Public License for more details at http://www.gnu.org/licenses/.
 *  
 * Copyright (C) 2014 Qloudgen Technology
*/

package com.qloudgen.csb.client;

import com.qloudgen.csb.CSBWorker;

public class Consumer extends CSBWorker { 

	protected Consumer(String conn) {
		super(conn);
	}
	
	MessageListener listener = null;
	public void setMessageListener(MessageListener listener) {
		this.listener = listener;
	}
	
	protected void doWork(String msg) {
		if (listener != null) {
			Message message = new Message(msg);
			listener.onMessage(message);
		}
	}
}

